/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 有点呆
 * Date: 2024-10-16
 * Time: 15:22
 */

class AAA{
    static{
        System.out.println("我是AAA中的静态块！");
    }
}

class Fish{
    int weight = 1;
}
class Lake{
    Fish fish;
    void setFish(Fish s){
        fish = s;
    }
    void foodFish(int m){
        fish.weight = fish.weight+m;
    }
}

class A {
    double f(int x, double y) {
        return x + y;
    }

    int f(int x, int y) {
        return x * y;
    }
}

public class Main {
    //    public static void main(String[] args) {
//        A a = new A();
//        System.out.println(a.f(10, 10));
//        System.out.println(a.f(10, 10.0));
//    }
    public static void main(String[] args) {
        Fish redFish = new Fish();
        System.out.println(redFish.weight);
        Lake lake = new Lake();
        lake.setFish(redFish);
        lake.foodFish(120);
        System.out.println(redFish.weight);
        System.out.println(lake.fish.weight);

//        static {
//            System.out.println("我是最先被执行的静态块！");
//        }
//        public static void main1 (String[]args){
//            AAA a = new AAA();
//            System.out.println("我在了解静态（static）块");
//        }
//    }
    }
}
